import { ref } from "vue";
import { apiList } from "@/api/apiList";
import type { UnwrapResData } from "@/api/types";

export const useUser = () => {
  const searchCondition = ref();

  const getUserList = async (params: {
    page?: number;
    pageSize?: number;
    username?: string;
    phone?: string;
    role?: string;
    status?: string;
  }): Promise<UnwrapResData<typeof apiList.user.getUserList>> => {
    const res = await apiList.user.getUserList(params);
    console.log(res);
    return res.data;
  };

  return {
    getUserList,
  };
};
